<?php $this->layout='main'; ?>

<?php $form = $this->beginWidget('CActiveForm', array(
		'id'=>'setup-form',
		'enableClientValidation'=>true,
		));
?>

<div id="buyer-setup">
<div id="setup-contents">

<div id="setup-head"><img src="<?php echo Yii::app()->request->baseUrl ?>/images/setup.gif" alt="" /></div>

<div id="setup-box1">
<div id="sb1-contents">
<div id="site-errors" align="left" style="color:#FF0000">
<?php
	echo $form->error($site_model, 'site_name');
	echo $form->error($site_model, 'ust_facility_ID');
	echo $form->error($site_model, 'address');
	echo $form->error($site_model, 'city');
	echo $form->error($site_model, 'state');
	echo $form->error($site_model, 'zip');
	echo $form->error($site_model, 'county');
	echo $form->error($site_model, 'geocode');
?>
</div>
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
          <th width="86"><img src="<?php echo Yii::app()->request->baseUrl ?>/images/ust-facility.gif" alt="" /></th>
          <td width="287">
          	<div class="textboxsb1">
          		<?php echo $form->textField($site_model, 'ust_facility_ID'); ?>
          	</div>
          </td>
    </tr>
    <tr>
          <th width="46"><img src="<?php echo Yii::app()->request->baseUrl ?>/images/sitename2.gif" alt="" /></th>
          <td>
          	<div class="textboxsb2">
          		<?php echo $form->textField($site_model, 'site_name'); ?>
          	</div>
          </td>
      </tr>
    <tr>
      <th width="86"><img src="<?php echo Yii::app()->request->baseUrl ?>/images/address1.gif" alt="" width="45" height="10" /></th>
      <td width="590">
      	<div class="textboxsb3">
      		<?php echo $form->textField($site_model, 'address'); ?>
      	</div>
      </td>
    </tr>
    <tr>
      <td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <th width="86"><img src="<?php echo Yii::app()->request->baseUrl ?>/images/city.gif" alt="" width="19" height="9" /></th>
          <td width="254">
          	<div class="textboxsb4">
          		<?php echo $form->textField($site_model, 'city'); ?>
          	</div>
          </td>
          <th width="29"><img src="<?php echo Yii::app()->request->baseUrl ?>/images/state.gif" alt="" width="24" height="10" /></th>
          <td width="77">
          <div class="rstep1-box4">
          		<?php echo $form->textField($site_model, 'state'); ?>
          </div>
          </td>
          <th width="30"><img src="<?php echo Yii::app()->request->baseUrl ?>/images/zip.gif" alt="" width="14" height="8" /></th>
          <td width="171">
          	<div class="textboxsb6">
          		<?php echo $form->textField($site_model, 'zip'); ?>
          	</div>
          </td>
        </tr>
      </table></td>
      </tr>
    <tr>
      <td colspan="2">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <th width="86"><img src="<?php echo Yii::app()->request->baseUrl ?>/images/county.gif" alt="" /></th>
    <td width="300">
    	<div class="textboxsb7">
    		<?php echo $form->textField($site_model, 'county'); ?>
    	</div>
    </td>
    <th width="69"><img src="<?php echo Yii::app()->request->baseUrl ?>/images/home-rack.gif" alt="" /></th>
    <td width="207"><img src="<?php echo Yii::app()->request->baseUrl ?>/images/assigned.gif" alt="" /></td>
  </tr>
</table>

      </td>
      </tr>
    <tr>
      <td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <th width="86"><img src="<?php echo Yii::app()->request->baseUrl ?>/images/preffered.gif" alt="" width="69" height="25" /></th>
          <td width="175"><img src="<?php echo Yii::app()->request->baseUrl ?>/images/assigned.gif" alt="" width="176" height="32" /></td>
          <th width="64"><img src="<?php echo Yii::app()->request->baseUrl ?>/images/long-lat.gif" alt="" /></th>
          <td width="326">
          	<div class="textboxsb7">
          		<?php echo $form->textField($site_model, 'geocode'); ?>
          	</div>
          </td>
        </tr>
      </table></td>
      </tr>
    <tr>
      <th width="86">&nbsp;</th>
      <td>
      <table width="90%" border="0" cellpadding="0" cellspacing="0" class="options">
<?php
function printFacilities()
{
	$records=Facilities::model()->findAll();
	$max=4;//the max columns that one row shows
	$length=count($records);
	for($i=0;$i<$length;$i+=$max)
	{
		echo '<tr>';
		for($j=0;$j+$i<$length;$j++)
		{
			echo "<td> <input name='facilities[]' type='checkbox' value='".$records[$i+$j]->facility_ID."' />".$records[$i+$j]->facility_name."</td>";
			if($j==$max-1)
				break;
		}
		echo '</tr>';
	}
}
printFacilities();
?>
</table>

      </td>
    </tr>
  </table>
</div>
<!-- End SB1 Contnets -->
</div><!-- End Setup Box1 -->

<div id="setup-box6">
    <div id="sb6-contents">
    
<div id="tank-errors" align="left" style="color:#FF0000">
<?php
//	echo $form->error($tank_model, 'capacity');
	echo $form->error($tank_model, 'tank_name');
//	echo $form->errorSummary($tank_model);
?>
</div>

    <div class="sb-box-head2"><img src="<?php echo Yii::app()->request->baseUrl ?>/images/tank-details.gif" alt="" /></div>
    <div class="tanks"><img src="<?php echo Yii::app()->request->baseUrl ?>/images/tanks.gif" alt="" /></div>
    
    <div id="sb6-left">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <th width="81"><img src="<?php echo Yii::app()->request->baseUrl ?>/images/tank-position.gif" alt="" width="64" height="10" /></th>
        <td>
        	<div class="textbox6">
        		<?php echo $form->dropDownList($tank_model, 'tank_position_ID', TankPositions::model()->getPositionsInfo(), array('style'=>'width:212px')); ?>
        	</div>
        </td>
      </tr>
      <tr>
        <th><img src="<?php echo Yii::app()->request->baseUrl ?>/images/tank-capacity2.gif" alt="" width="65" height="10" /></th>
        <td>
        	<div class="textbox6">
        		<?php echo $form->textField($tank_model, 'capacity'); ?>
        	</div>
        </td>
      </tr>
      <tr>
        <th><img src="<?php echo Yii::app()->request->baseUrl ?>/images/tank-product.gif" alt="" width="68" height="9" /></th>
        <td>
        	<div class="textbox6">
        		<?php echo $form->dropDownList($tank_model, 'product_ID', Products::model()->getProductsInfo(), array('style'=>'width:212px')); ?>
        	</div>
        </td>
      </tr>
    </table>
    </div><!-- End SB6 Left -->
    
    <div id="sb6-right">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <th width="85"><img src="<?php echo Yii::app()->request->baseUrl ?>/images/tankid.gif" alt="" width="36" height="8" /></th>
    <td>
    	<div class="textbox6">
    		<?php echo $form->textField($tank_model, 'tank_name'); ?>
    	</div>
    </td>
  </tr>
  <tr>
    <th><img src="<?php echo Yii::app()->request->baseUrl ?>/images/tanktype.gif" alt="" width="45" height="8" /></th>
    <td>
    	<div class="textbox7">
   			<?php echo $form->dropDownList($tank_model, 'tank_type_ID', TankTypes::model()->getTypesInfo(), array('style'=>'width:212px')); ?>
    	</div>
    </td>
  </tr>
  <tr>
    <th><img src="<?php echo Yii::app()->request->baseUrl ?>/images/tank-monitor.gif" alt="" width="65" height="9" /></th>
    <td>
    	<div class="textbox7">
    		<?php echo $form->dropDownList($tank_model, 'tank_monitor', array(1=>'YES', 0=>'NO'), array('style'=>'width:212px')); ?>
    	</div>
    </td>
  </tr>
  <tr>
    <th><img src="<?php echo Yii::app()->request->baseUrl ?>/images/pump-provided.gif" alt="" width="72" height="9" /></th>
    <td>
    	<div class="textbox6">
    		<?php echo $form->dropDownList($tank_model, 'pump_provided', array(1=>'YES', 0=>'NO'), array('style'=>'width:212px')); ?>
    	</div>
    </td>
  </tr>
  <tr>
    <th><img src="<?php echo Yii::app()->request->baseUrl ?>/images/drop-method.gif" alt="" width="62" height="9" /></th>
    <td>
    	<div class="textbox6">
    		<?php echo $form->dropDownList($tank_model, 'tank_drop_method_ID', TankDropMethods::model()->getDropMethodsInfo(), array('style'=>'width:212px')); ?>
    	</div>
    </td>
  </tr>
</table>

</div><!-- End SB6 Right -->
    
</div><!-- End SB6 Contents -->
</div><!-- End Setup Box6 -->

<div id="default"><input name="" type="checkbox" value="" />Make This My Default Site</div>
<div id="setup-sumbit"><input type="image" src="<?php echo Yii::app()->request->baseUrl ?>/images/submit3.jpg" /></div>

<?php $this->endWidget(); ?>

<div id="really-easy">Easy</div>
</div><!-- End Setup Contents -->


